import { Input, linkDir, log } from '../../core';
import { ActionBase } from '../action-base/action-base';
import { resolve, basename } from 'path';
import * as fs from 'fs';

/**
 * 对「文件、文件夹」建立软链接
 *
 * @author chitanda
 * @date 2021-04-18 13:04:24
 * @export
 * @class LinkAction
 * @extends {ActionBase}
 */
export class LinkAction extends ActionBase {
  async handle(input: Input, options: Input, _extraFlags?: string[]): Promise<void> {
    const { source, target } = input;
    const { force } = options;
    linkDir(source.value, target.value, force.value);
  }
}
